#!/bin/bash
set -e

programs/build_helpers/buildstep -s 3500
ccache -s
programs/build_helpers/buildstep Prepare 1 "sed -i '/tests/d' libraries/fc/CMakeLists.txt"
programs/build_helpers/buildstep cmake 5 "cmake -DCMAKE_BUILD_TYPE=Debug -DCMAKE_C_FLAGS=--coverage -DCMAKE_CXX_FLAGS=--coverage -DBoost_USE_STATIC_LIBS=OFF -DCMAKE_CXX_OUTPUT_EXTENSION_REPLACE=ON ."
programs/build_helpers/buildstep make.some.targets 2400 "make -j 2 witness_node cli_wallet chain_test cli_test js_operation_serializer get_dev_key network_mapper"
programs/build_helpers/buildstep make.others 600 "make"
set -o pipefail
programs/build_helpers/buildstep run.chain_test 300 "libraries/fc/tests/run-parallel-tests.sh tests/chain_test -l message"
programs/build_helpers/buildstep run.cli_test 120 "libraries/fc/tests/run-parallel-tests.sh tests/cli_test -l message"
programs/build_helpers/buildstep end 0
ccache -s

